package org.linuxsogood.boot.queue;

import cn.hutool.json.JSONUtil;
import com.example.demo.queue.beans.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liu.hongwei
 * @since 2020/8/26 10:02
 */
public class TestData {

    public static void main(String[] args) {
        final Dance dance = new Dance();
        final List<LightBelt> lightBelts = new ArrayList<>();
        dance.setLightBelts(lightBelts);

        final LightBelt lb1 = new LightBelt();
        lb1.setStartSeconds(0);
        lb1.setDuration(5);
        lb1.setType(0);
        lb1.setPosition(0);
        lb1.setColor("255,127,80");
        lightBelts.add(lb1);

        final LightBelt lb2 = new LightBelt();
        lb2.setStartSeconds(0);
        lb2.setDuration(5);
        lb2.setType(1);
        lb2.setPosition(1);
        lb2.setColor("255,20,147#255,0,255");
        lightBelts.add(lb2);

        final LightBelt lb3 = new LightBelt();
        lb3.setStartSeconds(0);
        lb3.setDuration(5);
        lb3.setType(1);
        lb3.setPosition(2);
        lb3.setColor("255,20,147#255,0,255");
        lightBelts.add(lb3);

        final LightBelt lb4 = new LightBelt();
        lb4.setStartSeconds(0);
        lb4.setDuration(5);
        lb4.setType(3);
        lb4.setPosition(3);
        lb4.setColor("255,215,0#218,165,32");
        lb4.setStreamDirection(1);
        lb4.setStreamSpeed(1.2);
        lightBelts.add(lb4);

        final LightBelt lb5 = new LightBelt();
        lb5.setStartSeconds(5);
        lb5.setDuration(8);
        lb5.setType(4);
        lb5.setPosition(0);
        lightBelts.add(lb5);

        final LightBelt lb6 = new LightBelt();
        lb6.setStartSeconds(5);
        lb6.setDuration(8);
        lb6.setType(4);
        lb6.setPosition(1);
        lightBelts.add(lb6);

        final LightBelt lb7 = new LightBelt();
        lb7.setStartSeconds(5);
        lb7.setDuration(8);
        lb7.setType(4);
        lb7.setPosition(2);
        lightBelts.add(lb7);

        final LightBelt lb8 = new LightBelt();
        lb8.setStartSeconds(5);
        lb8.setDuration(8);
        lb8.setType(4);
        lb8.setPosition(3);
        lightBelts.add(lb8);

        List<Movement> movements = new ArrayList<>();
        final Movement mb1 = new Movement();
        mb1.setDistance(1);
        mb1.setSpeed(0.8);
        mb1.setType(0);
        mb1.setMoveDirection(0);
        mb1.setStartSeconds(1);
        mb1.setDuration(5);
        movements.add(mb1);

        final Movement mb2 = new Movement();
        mb1.setDistance(1);
        mb2.setSpeed(0.8);
        mb2.setType(0);
        mb2.setMoveDirection(1);
        mb2.setStartSeconds(6);
        mb2.setDuration(5);
        movements.add(mb2);

        final Movement mb3 = new Movement();
        mb3.setDistance(1);
        mb3.setSpeed(0.8);
        mb3.setType(0);
        mb3.setMoveDirection(2);
        mb3.setStartSeconds(11);
        mb3.setDuration(5);
        movements.add(mb3);

        final Movement mb4 = new Movement();
        mb4.setDistance(1);
        mb4.setSpeed(0.8);
        mb4.setType(0);
        mb4.setMoveDirection(3);
        mb4.setStartSeconds(16);
        mb4.setDuration(5);
        movements.add(mb4);

        final Movement mbx = new Movement();
        mbx.setStartSeconds(3);
        mbx.setDuration(10);
        mbx.setRotateAngle(30);
        mbx.setHeadDirection(0);
        mbx.setType(1);
        movements.add(mbx);

        final Movement mby = new Movement();
        mby.setStartSeconds(13);
        mby.setDuration(10);
        mby.setRotateAngle(30);
        mby.setHeadDirection(1);
        mby.setType(1);
        movements.add(mby);
        dance.setMovements(movements);

        List<Media> media = new ArrayList<>();
        final Media m1 = new Media();
        m1.setStartSeconds(0);
        m1.setDuration(8);
        m1.setType(1);
        m1.setContent("欢迎观看机器人表演, 下面请欣赏一剪梅!");
        media.add(m1);

        final Media m2 = new Media();
        m2.setStartSeconds(8);
        m2.setDuration(120);
        m2.setType(3);
        m2.setContent("<iframe frameborder=\"no\" border=\"0\" marginwidth=\"0\" marginheight=\"0\" width=330 height=86 src=\"//music.163.com/outchain/player?type=2&id=82932&auto=1&height=66\"></iframe>");
        media.add(m2);
        dance.setMedia(media);

        final String s = JSONUtil.toJsonStr(dance);
        System.out.println(s);

    }
}
